package com.aspose.cells;

import java.util.ArrayList;

class zauc {
   protected float a;
   protected float b;
   protected float c;
   protected float d;
   protected float e;
   protected float f;
   protected zaui[] g;
   protected ArrayList h;
   protected double[] i;
   protected zjg j;
   protected Color[] k;
   protected String[] l;
   protected com.aspose.cells.b.a.b.zg m;
   protected Color n;
   protected float[] o;
   protected int p;
   protected float q;
   protected int r;
   protected boolean s;
   protected int t;
   private boolean u;

   protected zauc() {
      this.e = 0.0F;
      this.f = 0.0F;
      this.h = new ArrayList();
      this.i = new double[0];
      this.j = null;
      this.k = new Color[]{Color.getRed(), Color.getGreen(), Color.getBlue(), Color.getYellow(), Color.getPurple(), Color.getOlive(), Color.getNavy(), Color.getAqua(), Color.getLime(), Color.getMaroon(), Color.getTeal(), Color.getFuchsia()};
      this.n = com.aspose.cells.b.a.b.zw.a();
      this.o = new float[]{0.0F};
      this.p = 1;
      this.q = 1.0F;
      this.r = 0;
      this.s = true;
      this.t = -1;
      this.u = false;
   }

   public zauc(float var1, float var2, float var3, float var4, double[] var5) {
      this();
      this.a = var1;
      this.b = var2;
      this.c = var3;
      this.d = var4;
      this.a(var5);
   }

   public zauc(float var1, float var2, float var3, float var4, double[] var5, float var6) {
      this(var1, var2, var3, var4, var5);
      this.e = var6;
   }

   public zauc(float var1, float var2, float var3, float var4, double[] var5, Color[] var6, float var7) {
      this(var1, var2, var3, var4, var5, var7);
      this.k = var6;
   }

   public zauc(float var1, float var2, float var3, float var4, double[] var5, Color[] var6, float var7, String[] var8) {
      this(var1, var2, var3, var4, var5, var6, var7);
      this.l = var8;
   }

   public zauc(float var1, float var2, float var3, float var4, double[] var5, Color[] var6, float var7, String[] var8, zjg var9) {
      this(var1, var2, var3, var4, var5, var6, var7, var8);
      this.j = var9;
   }

   protected void finalize() throws Exception {
      this.a(false);
   }

   public void a() {
      this.a(true);
      com.aspose.cells.b.a.zg.a(this);
   }

   public void b() {
      this.a();
   }

   protected void a(boolean var1) {
      if (!this.u) {
         if (var1) {
            zaui[] var2 = this.g;
            int var3 = var2.length;

            for(int var4 = 0; var4 < var3; ++var4) {
               zaui var5 = var2[var4];
               var5.a();
            }
         }

         this.u = true;
      }

   }

   public void a(double[] var1) {
      this.i = var1;
   }

   public void a(Color var1) {
      this.n = var1;
   }

   public void a(float[] var1) {
      this.o = var1;
   }

   public void a(float var1) {
      this.f = var1 % 360.0F;
      if (this.f < 0.0F) {
         this.f += 360.0F;
      }

   }

   void a(zbcq var1) {
      zjg var2 = var1.E();
      int var3 = var1.v().E();
      this.a((float)(var3 - 90));
      float[] var4 = new float[var2.getCount()];

      for(int var5 = 0; var5 < var2.getCount(); ++var5) {
         var4[var5] = var2.a(var5).E() / 100.0F;
      }

      this.a(var4);
      zpu var7 = var1.w();
      this.m = var7.a().h();
      this.a(var7.a().j());
      this.h();
      if (this.s) {
         com.aspose.cells.b.a.b.zq var6 = this.c();
         this.a(var6);
      }

   }

   public void a(zn var1) {
      com.aspose.cells.b.a.b.a.zf var2 = var1.e();
      var1.a(4);
      this.c(var1);
      var1.a(var2);
      com.aspose.cells.b.a.b.a.zf var3 = var1.e();
      var1.a(0);
      if (this.e > 0.0F) {
         this.b(var1);
      }

      var1.a(var3);
      com.aspose.cells.b.a.b.a.zf var4 = var1.e();
      var1.a(4);
      if (this.e > 0.0F) {
         this.b(var1);
      }

      this.d(var1);
      var1.a(var4);
   }

   public void a(zn var1, zbcq var2) throws Exception {
      zauf.a(var2.E());
      com.aspose.cells.b.a.b.zv var3 = new com.aspose.cells.b.a.b.zv();
      var3.a(1);
      var3.c(1);
      zig var4 = this.j.b();
      double var5 = 0.0D;
      double[] var7 = this.i;
      int var8 = var7.length;

      for(int var9 = 0; var9 < var8; ++var9) {
         double var10 = var7[var9];
         var5 += var10;
      }

      com.aspose.cells.b.a.b.a.ze var31 = this.i();
      com.aspose.cells.b.a.b.zq var32 = com.aspose.cells.a.c.zn.a(var31);
      zaui[] var33 = this.g;
      int var34 = var33.length;

      for(int var11 = 0; var11 < var34; ++var11) {
         zaui var12 = var33[var11];
         if (var12 != null && var12.i().length() >= 1) {
            zje var13 = var12.m();
            zbcq var14 = var13.g().a();
            zpu var15 = var13.o();
            if (var15.t()) {
               double var16;
               if (var5 == 0.0D) {
                  var16 = 0.0D;
               } else {
                  var16 = Math.abs(var13.v()) / var5;
               }

               float var18;
               if (var15.a().d().g()) {
                  var18 = (float)var4.a() * 0.175F;
               } else {
                  var18 = (float)var4.a() * 0.2F;
               }

               float var19 = (float)var4.b();
               com.aspose.cells.b.a.b.zt var20 = zauf.a(var1, var4.z(), var14.aj(), var13.G(), var16, var18, var19, 0.0D);
               com.aspose.cells.b.a.b.zq var21 = com.aspose.cells.b.a.b.zq.c();
               float var22 = 0.0F;
               com.aspose.cells.b.a.b.zo var23 = com.aspose.cells.b.a.b.zo.a();
               boolean var24 = false;
               int var25 = var15.j();

               float[] var27;
               while(!var24) {
                  com.aspose.cells.b.a.b.zo[] var37;
                  switch(var25) {
                  case 1:
                     float[] var35 = new float[]{var22};
                     var23 = var12.a(0.25F, var35);
                     var22 = var35[0];
                     var23.a(var23.d() - var20.b() / 2.0F);
                     var23.b(var23.e() - var20.c() / 2.0F);
                     var24 = true;
                     break;
                  case 2:
                  case 5:
                  case 6:
                  case 7:
                  case 8:
                  default:
                     float var39 = 0.47F;
                     float[] var29 = new float[]{var22};
                     var23 = var12.a(var39, var29);
                     var22 = var29[0];
                     com.aspose.cells.b.a.b.zo[] var41 = new com.aspose.cells.b.a.b.zo[]{var23};
                     this.b(var12, var41, var22, var20);
                     var23 = var41[0];
                     boolean var42 = this.a(var1, var12, new com.aspose.cells.b.a.b.zq(var23, var20));
                     if (var42) {
                        var24 = true;
                     } else {
                        com.aspose.cells.b.a.b.zo var30 = this.a(var1, var12, var20, var22);
                        if (var30.b()) {
                           var24 = false;
                           var25 = 4;
                        } else {
                           var23 = var30;
                           var24 = true;
                        }
                     }
                     break;
                  case 3:
                     float var26 = 0.485F;
                     var27 = new float[]{var22};
                     var23 = var12.a(var26, var27);
                     var22 = var27[0];
                     var37 = new com.aspose.cells.b.a.b.zo[]{var23};
                     this.b(var12, var37, var22, var20);
                     var23 = var37[0];
                     var24 = true;
                     break;
                  case 4:
                     var27 = new float[]{var22};
                     var23 = var12.a(0.5F, var27);
                     var22 = var27[0];
                     var37 = new com.aspose.cells.b.a.b.zo[]{var23};
                     this.a(var12, var37, var22, var20);
                     var23 = var37[0];
                     var24 = true;
                     break;
                  case 9:
                     var27 = new float[]{var22};
                     var23 = var12.a(0.5F, var27);
                     var22 = var27[0];
                     var37 = new com.aspose.cells.b.a.b.zo[]{var23};
                     this.a(var12, var37, var22, var20);
                     var23 = var37[0];
                     com.aspose.cells.b.a.b.zq var38 = new com.aspose.cells.b.a.b.zq((float)zbuk.a((double)var23.d()), (float)zbuk.a((double)var23.e()), (float)zbuk.a((double)var20.b()), (float)zbuk.a((double)var20.c()));
                     com.aspose.cells.b.a.b.zq[] var28 = new com.aspose.cells.b.a.b.zq[]{var38};
                     var4.a(var28);
                     var38 = var28[0];
                     var15.a().b = zbuk.c(com.aspose.cells.b.a.b.zp.a(var38));
                     var15.a().z();
                     var23 = new com.aspose.cells.b.a.b.zo((float)var15.a().a.c(), (float)var15.a().a.d());
                     var24 = true;
                  }
               }

               var21 = new com.aspose.cells.b.a.b.zq(var23, var20);
               com.aspose.cells.b.a.b.zq[] var36 = new com.aspose.cells.b.a.b.zq[]{var21};
               var4.a(var36);
               var21 = var36[0];
               zauf.a(var1, var4, var14.aj(), var13.G(), var16, var21, 0.0D);
               if (var13.g().a().R() && var15.j() == 9) {
                  var27 = new float[]{var22};
                  com.aspose.cells.b.a.b.zo var40 = var12.a(0.5F, var27);
                  var22 = var27[0];
                  if (var22 >= 0.0F && var22 <= 180.0F) {
                     var40.b(var40.e() + var12.k());
                  }

                  this.a(var1, var32, var12, var13.g().a().S(), var21, var40);
               }
            }
         }
      }

   }

   private void a(zaui var1, com.aspose.cells.b.a.b.zo[] var2, float var3, com.aspose.cells.b.a.b.zt var4) {
      if ((double)var3 > 67.5D && (double)var3 < 112.5D) {
         var2[0].a((float)((double)var2[0].d() - ((double)var3 - 67.5D) * (double)var4.b() / 45.0D));
      } else if ((double)var3 >= 112.5D && (double)var3 <= 247.5D) {
         var2[0].a(var2[0].d() - var4.b());
      } else if ((double)var3 > 247.5D && (double)var3 < 292.5D) {
         var2[0].a((float)((double)(var2[0].d() - var4.b()) + ((double)var3 - 247.5D) * (double)var4.b() / 45.0D));
      }

      if (var3 >= 0.0F && var3 <= 180.0F) {
         var2[0].b(var2[0].e() + var1.k());
      } else if (var3 < 225.0F && var3 > 180.0F) {
         var2[0].b(var2[0].e() - (var3 - 135.0F) * var4.c() / 90.0F);
      } else if (var3 >= 225.0F && var3 <= 315.0F) {
         var2[0].b(var2[0].e() - var4.c());
      } else if (var3 > 315.0F && var3 <= 360.0F) {
         var2[0].b(var2[0].e() - var4.c() + (var3 - 315.0F) * var4.c() / 90.0F);
      }

   }

   private void b(zaui var1, com.aspose.cells.b.a.b.zo[] var2, float var3, com.aspose.cells.b.a.b.zt var4) {
      if ((double)var3 > 67.5D && (double)var3 < 112.5D) {
         var2[0].a((float)((double)var2[0].d() - (112.5D - (double)var3) * (double)var4.b() / 45.0D));
      } else if ((double)var3 > 247.5D && (double)var3 < 292.5D) {
         var2[0].a((float)((double)var2[0].d() - ((double)var3 - 247.5D) * (double)var4.b() / 45.0D));
      } else if ((double)var3 <= 67.5D || (double)var3 >= 292.5D) {
         var2[0].a(var2[0].d() - var4.b());
      }

      if ((double)var3 < 22.5D) {
         var2[0].b(var2[0].e() - var4.c() / 2.0F - var3 * var4.c() / 45.0F);
      } else if ((double)var3 > 337.5D) {
         var2[0].b(var2[0].e() - var4.c() / 2.0F + (360.0F - var3) * var4.c() / 45.0F);
      } else if ((double)var3 > 157.5D && (double)var3 < 202.5D) {
         var2[0].b((float)((double)var2[0].e() - (202.5D - (double)var3) * (double)var4.c() / 45.0D));
      } else if ((double)var3 <= 157.5D && (double)var3 >= 22.5D) {
         var2[0].b(var2[0].e() - var4.c());
      }

   }

   private void a(zn var1, com.aspose.cells.b.a.b.zq var2, zaui var3, zalw var4, com.aspose.cells.b.a.b.zq var5, com.aspose.cells.b.a.b.zo var6) {
      float var7 = var3.j().h() / 2.0F * 0.05F;
      com.aspose.cells.b.a.b.zo var8 = new com.aspose.cells.b.a.b.zo(var2.f() + var2.h() / 2.0F, var2.g() + var2.i() / 2.0F);
      if (var6.d() < var8.d()) {
         var6.a(var6.d() - 1.0F);
      } else {
         var6.a(var6.d() + 1.0F);
      }

      if (var6.e() < var8.e()) {
         var6.b(var6.e() - 1.0F);
      } else {
         var6.b(var6.e() + 1.0F);
      }

      com.aspose.cells.b.a.b.zo var10 = new com.aspose.cells.b.a.b.zo(var5.j(), var5.k() + var5.i() / 3.0F);
      com.aspose.cells.b.a.b.zo var11 = new com.aspose.cells.b.a.b.zo(var5.j() + var5.h() / 3.0F, var5.k());
      com.aspose.cells.b.a.b.zo var12 = new com.aspose.cells.b.a.b.zo(var5.l(), var5.k() + var5.i() / 3.0F);
      com.aspose.cells.b.a.b.zo var13 = new com.aspose.cells.b.a.b.zo(var5.j() + var5.h() / 3.0F, var5.m());
      int var14 = this.a(var6, var5);
      com.aspose.cells.b.a.b.zm var15 = null;
      com.aspose.cells.b.a.b.a.ze var16 = new com.aspose.cells.b.a.b.a.ze();
      com.aspose.cells.b.a.b.zo var17 = com.aspose.cells.b.a.b.zo.a();
      com.aspose.cells.b.a.b.a.ze var18;
      switch(var14) {
      case 1:
         var17 = new com.aspose.cells.b.a.b.zo(var12.d() + var7, var12.e());
         var16.a(var12, var17);
         var16.a(var17, var6);
         var15 = var4.b(var16);
         var16.a(var15);
         if (this.a(var1, var16) && var17.d() <= var6.d()) {
            var18 = new com.aspose.cells.b.a.b.a.ze();
            var18.a(var12, var17);
            var18.a(var17, var6);
            var1.a(var15, var18);
            var18.g();
         }
         break;
      case 2:
         var17 = new com.aspose.cells.b.a.b.zo(var12.d() + var7, var12.e());
         var16.a(var12, var17);
         var16.a(var17, var6);
         var15 = var4.b(var16);
         var16.a(var15);
         if (this.a(var1, var16) && var17.d() <= var6.d()) {
            var18 = new com.aspose.cells.b.a.b.a.ze();
            var18.a(var12, var17);
            var18.a(var17, var6);
            var1.a(var15, var18);
            var18.g();
         } else {
            var16 = new com.aspose.cells.b.a.b.a.ze();
            var17 = new com.aspose.cells.b.a.b.zo(var13.d(), var13.e() + var7);
            var16.a(var13, var17);
            var16.a(var17, var6);
            if (var15 != null) {
               var15.a();
            }

            var15 = var4.b(var16);
            var16.a(var15);
            if (this.a(var1, var16) && var17.e() <= var6.e()) {
               var18 = new com.aspose.cells.b.a.b.a.ze();
               var18.a(var13, var17);
               var18.a(var17, var6);
               var1.a(var15, var18);
               var18.g();
            }
         }
         break;
      case 3:
         var16 = new com.aspose.cells.b.a.b.a.ze();
         var17 = new com.aspose.cells.b.a.b.zo(var13.d(), var13.e() + var7);
         var16.a(var13, var17);
         var16.a(var17, var6);
         var15 = var4.b(var16);
         var16.a(var15);
         if (this.a(var1, var16) && var17.e() <= var6.e()) {
            var18 = new com.aspose.cells.b.a.b.a.ze();
            var18.a(var13, var17);
            var18.a(var17, var6);
            var1.a(var15, var18);
            var18.g();
         }
         break;
      case 4:
         var16 = new com.aspose.cells.b.a.b.a.ze();
         var17 = new com.aspose.cells.b.a.b.zo(var10.d() - var7, var10.e());
         var16.a(var10, var17);
         var16.a(var17, var6);
         var15 = var4.b(var16);
         var16.a(var15);
         if (this.a(var1, var16) && var17.d() >= var6.d()) {
            var18 = new com.aspose.cells.b.a.b.a.ze();
            var18.a(var10, var17);
            var18.a(var17, var6);
            var1.a(var15, var18);
            var18.g();
         } else {
            var16 = new com.aspose.cells.b.a.b.a.ze();
            var17 = new com.aspose.cells.b.a.b.zo(var13.d(), var13.e() + var7);
            var16.a(var13, var17);
            var16.a(var17, var6);
            if (var15 != null) {
               var15.a();
            }

            var15 = var4.b(var16);
            var16.a(var15);
            if (this.a(var1, var16) && var17.e() <= var6.e()) {
               var18 = new com.aspose.cells.b.a.b.a.ze();
               var18.a(var13, var17);
               var18.a(var17, var6);
               var1.a(var15, var18);
               var18.g();
            }
         }
         break;
      case 5:
         var16 = new com.aspose.cells.b.a.b.a.ze();
         var17 = new com.aspose.cells.b.a.b.zo(var10.d() - var7, var10.e());
         var16.a(var10, var17);
         var16.a(var17, var6);
         var15 = var4.b(var16);
         var16.a(var15);
         if (this.a(var1, var16) && var17.d() >= var6.d()) {
            var18 = new com.aspose.cells.b.a.b.a.ze();
            var18.a(var10, var17);
            var18.a(var17, var6);
            var1.a(var15, var18);
            var18.g();
         }
         break;
      case 6:
         var16 = new com.aspose.cells.b.a.b.a.ze();
         var17 = new com.aspose.cells.b.a.b.zo(var10.d() - var7, var10.e());
         var16.a(var10, var17);
         var16.a(var17, var6);
         var15 = var4.b(var16);
         var16.a(var15);
         if (this.a(var1, var16) && var17.d() >= var6.d()) {
            var18 = new com.aspose.cells.b.a.b.a.ze();
            var18.a(var10, var17);
            var18.a(var17, var6);
            var1.a(var15, var18);
            var18.g();
         } else {
            var16 = new com.aspose.cells.b.a.b.a.ze();
            var17 = new com.aspose.cells.b.a.b.zo(var11.d(), var11.e() - var7);
            var16.a(var11, var17);
            var16.a(var17, var6);
            if (var15 != null) {
               var15.a();
            }

            var15 = var4.b(var16);
            var16.a(var15);
            if (this.a(var1, var16) && var17.e() >= var6.e()) {
               var18 = new com.aspose.cells.b.a.b.a.ze();
               var18.a(var11, var17);
               var18.a(var17, var6);
               var1.a(var15, var18);
               var18.g();
            }
         }
         break;
      case 7:
         var16 = new com.aspose.cells.b.a.b.a.ze();
         var17 = new com.aspose.cells.b.a.b.zo(var11.d(), var11.e() - var7);
         var16.a(var11, var17);
         var16.a(var17, var6);
         var15 = var4.b(var16);
         var16.a(var15);
         if (this.a(var1, var16) && var17.e() >= var6.e()) {
            var18 = new com.aspose.cells.b.a.b.a.ze();
            var18.a(var11, var17);
            var18.a(var17, var6);
            var1.a(var15, var18);
            var18.g();
         }
         break;
      case 8:
         var16 = new com.aspose.cells.b.a.b.a.ze();
         var17 = new com.aspose.cells.b.a.b.zo(var12.d() + var7, var12.e());
         var16.a(var12, var17);
         var16.a(var17, var6);
         var15 = var4.b(var16);
         var16.a(var15);
         if (this.a(var1, var16) && var17.d() <= var6.d()) {
            var18 = new com.aspose.cells.b.a.b.a.ze();
            var18.a(var12, var17);
            var18.a(var17, var6);
            var1.a(var15, var18);
            var18.g();
         } else {
            var16 = new com.aspose.cells.b.a.b.a.ze();
            var17 = new com.aspose.cells.b.a.b.zo(var11.d(), var11.e() - var7);
            var16.a(var11, var17);
            var16.a(var17, var6);
            if (var15 != null) {
               var15.a();
            }

            var15 = var4.b(var16);
            var16.a(var15);
            if (this.a(var1, var16) && var17.e() >= var6.e()) {
               var18 = new com.aspose.cells.b.a.b.a.ze();
               var18.a(var11, var17);
               var18.a(var17, var6);
               var1.a(var15, var18);
               var18.g();
            }
         }
      }

      if (var15 != null) {
         var15.a();
      }

      var15 = null;
   }

   private boolean a(zn var1, com.aspose.cells.b.a.b.a.ze var2) {
      zaui[] var3 = this.g;
      int var4 = var3.length;

      for(int var5 = 0; var5 < var4; ++var5) {
         zaui var6 = var3[var5];
         com.aspose.cells.b.a.b.a.ze var7 = new com.aspose.cells.b.a.b.a.ze();
         var7.b(var6.j().f(), var6.j().g(), var6.j().h(), var6.j().i(), var6.c(), var6.d());
         com.aspose.cells.b.a.b.zr var8 = new com.aspose.cells.b.a.b.zr(var2);

         label183: {
            boolean var9;
            try {
               var8.a(var7);
               if (var1.a().b(var8)) {
                  break label183;
               }

               var9 = false;
            } finally {
               if (var8 != null) {
                  var8.b();
               }

            }

            return var9;
         }

         com.aspose.cells.b.a.b.a.ze var19 = new com.aspose.cells.b.a.b.a.ze();
         var19.b(var6.j().f(), var6.j().g() + var6.k(), var6.j().h(), var6.j().i(), var6.c(), var6.d());
         com.aspose.cells.b.a.b.zr var10 = new com.aspose.cells.b.a.b.zr(var2);

         try {
            var10.a(var19);
            if (!var1.a().b(var10)) {
               boolean var11 = false;
               return var11;
            }
         } finally {
            if (var10 != null) {
               var10.b();
            }

         }
      }

      return true;
   }

   private int a(com.aspose.cells.b.a.b.zo var1, com.aspose.cells.b.a.b.zq var2) {
      boolean var3 = false;
      byte var4;
      if (var2.l() < var1.d()) {
         if (var2.m() < var1.e()) {
            var4 = 2;
         } else if (var2.k() > var1.e()) {
            var4 = 8;
         } else {
            var4 = 1;
         }
      } else if (var2.j() > var1.d()) {
         if (var2.m() < var1.e()) {
            var4 = 4;
         } else if (var2.k() > var1.e()) {
            var4 = 6;
         } else {
            var4 = 5;
         }
      } else if (var2.m() < var1.e()) {
         var4 = 3;
      } else if (var2.k() > var1.e()) {
         var4 = 7;
      } else {
         var4 = 0;
      }

      return var4;
   }

   private com.aspose.cells.b.a.b.a.ze i() {
      com.aspose.cells.b.a.b.a.ze var1 = new com.aspose.cells.b.a.b.a.ze();
      zaui[] var2 = this.g;
      int var3 = var2.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         zaui var5 = var2[var4];
         var1.b(var5.j().f(), var5.j().g(), var5.j().h(), var5.j().i(), var5.c(), var5.d());
         var1.b(var5.j().f(), var5.j().g() + var5.k(), var5.j().h(), var5.j().i(), var5.c(), var5.d());
      }

      return var1;
   }

   private boolean a(zn var1, zaui var2, com.aspose.cells.b.a.b.zq var3) {
      var3 = new com.aspose.cells.b.a.b.zq(var3.f(), var3.g(), var3.h(), var3.i());
      com.aspose.cells.b.a.b.a.ze var4 = new com.aspose.cells.b.a.b.a.ze();

      boolean var7;
      try {
         var4.b(new com.aspose.cells.b.a.b.zq(this.a, this.b, this.c, this.d));
         com.aspose.cells.b.a.b.a.ze var5 = new com.aspose.cells.b.a.b.a.ze();
         var5.b(var2.j().f(), var2.j().g(), var2.j().h(), var2.j().i(), var2.c(), var2.d());
         com.aspose.cells.b.a.b.zr var6 = new com.aspose.cells.b.a.b.zr(var4);

         try {
            var6.b(var5);
            if (var2.m().o().a().d().c() == 0 || var2.m().o().a().d().a().isEmpty()) {
               var3.a((float)(-zpw.a), (float)(-zpw.a));
            }

            var6.a(var3);
            if (!var1.a().b(var6)) {
               var6.c();
               var7 = false;
               return var7;
            }

            var6.c();
            var7 = true;
         } finally {
            if (var6 != null) {
               var6.b();
            }

         }
      } finally {
         if (var4 != null) {
            var4.h();
         }

      }

      return var7;
   }

   private com.aspose.cells.b.a.b.zo a(zn var1, zaui var2, com.aspose.cells.b.a.b.zt var3, float var4) {
      float var5 = 0.0F;
      float var6 = 0.0F;
      float var7 = 0.5F;
      boolean var8 = false;
      zaui var9;
      com.aspose.cells.b.a.b.zq var10;
      if (var4 >= 90.0F && (var4 < 180.0F || var4 >= 270.0F)) {
         var9 = this.a(var2, 0.0F);
         var8 = false;

         while(var9.g() > var2.g() - var2.h() / 2.0F) {
            var9 = this.a(var9, -var7);
            var10 = this.a(var9, var3);
            var5 -= var7;
            if (this.a(var1, var2, var10)) {
               var6 -= var7;
               if (!var8) {
                  var8 = true;
               }
            } else if (var8) {
               var9 = this.a(var2, 0.0F);
               var9 = this.a(var9, var5 - var6 / 2.0F);
               var10 = this.a(var9, var3);
               return var10.d();
            }
         }

         var9 = this.a(var2, 0.0F);
         var8 = false;

         while(var9.g() < var2.g() + var2.h() / 2.0F) {
            var9 = this.a(var9, var7);
            var10 = this.a(var9, var3);
            var5 += var7;
            if (this.a(var1, var2, var10)) {
               var6 += var7;
               if (!var8) {
                  var8 = true;
               }
            } else if (var8) {
               var9 = this.a(var2, 0.0F);
               var9 = this.a(var9, var5 - var6 / 2.0F);
               var10 = this.a(var9, var3);
               return var10.d();
            }
         }
      } else {
         var9 = this.a(var2, 0.0F);
         var8 = false;

         while(var9.g() < var2.g() + var2.h() / 2.0F) {
            var9 = this.a(var9, var7);
            var10 = this.a(var9, var3);
            var5 += var7;
            if (this.a(var1, var2, var10)) {
               var6 += var7;
               if (!var8) {
                  var8 = true;
               }
            } else if (var8) {
               var9 = this.a(var2, 0.0F);
               var9 = this.a(var9, var5 - var6 / 2.0F);
               var10 = this.a(var9, var3);
               return var10.d();
            }
         }

         var9 = this.a(var2, 0.0F);
         var8 = false;

         while(var9.g() > var2.g() - var2.h() / 2.0F) {
            var9 = this.a(var9, -var7);
            var10 = this.a(var9, var3);
            var5 -= var7;
            if (this.a(var1, var2, var10)) {
               var6 -= var7;
               if (!var8) {
                  var8 = true;
               }
            } else if (var8) {
               var9 = this.a(var2, 0.0F);
               var9 = this.a(var9, var5 - var6 / 2.0F);
               var10 = this.a(var9, var3);
               return var10.d();
            }
         }
      }

      return com.aspose.cells.b.a.b.zo.a();
   }

   private zaui a(zaui var1, float var2) {
      zaui var3 = var1.a(var2);
      return var3;
   }

   private com.aspose.cells.b.a.b.zq a(zaui var1, com.aspose.cells.b.a.b.zt var2) {
      float var3 = 0.485F;
      float var4 = 0.0F;
      float[] var5 = new float[]{var4};
      com.aspose.cells.b.a.b.zo var6 = var1.a(var3, var5);
      var4 = var5[0];
      if (var4 <= 90.0F || var4 >= 270.0F) {
         var6.a(var6.d() - var2.b());
      }

      if (var4 >= 0.0F && var4 <= 180.0F) {
         var6.b(var6.e() - var2.c());
      }

      return new com.aspose.cells.b.a.b.zq(var6, var2);
   }

   protected com.aspose.cells.b.a.b.zq c() {
      com.aspose.cells.b.a.b.zq var1 = this.g[0].l();

      for(int var2 = 1; var2 < this.g.length; ++var2) {
         var1 = com.aspose.cells.b.a.b.zq.a(var1, this.g[var2].l());
      }

      return var1;
   }

   protected void a(com.aspose.cells.b.a.b.zq var1) {
      float var2 = this.c / var1.h();
      float var3 = this.d / var1.i();
      float var4 = var1.f() - this.a;
      float var5 = var1.g() - this.b;
      zaui[] var6 = this.g;
      int var7 = var6.length;

      for(int var8 = 0; var8 < var7; ++var8) {
         zaui var9 = var6[var8];
         float var10 = var9.j().f() - var4;
         float var11 = var9.j().g() - var5;
         float var12 = var9.j().h() * var2;
         float var13 = var9.j().i() * var3;
         float var14 = var9.k() * var3;
         var9.a(var10, var11, var12, var13, var14);
      }

   }

   protected float d() {
      float var1 = 0.0F;

      for(int var2 = 0; var2 < this.o.length && var2 < this.i.length; ++var2) {
         if (this.o[var2] > var1) {
            var1 = this.o[var2];
         }
      }

      return var1;
   }

   protected com.aspose.cells.b.a.b.zt e() {
      float var1 = 1.0F + this.d();
      float var2 = this.c / var1;
      float var3 = this.d / var1 * (1.0F - this.e);
      return new com.aspose.cells.b.a.b.zt(var2, var3);
   }

   protected com.aspose.cells.b.a.b.zt f() {
      float var1 = this.d();
      float var2 = this.e().b() * var1;
      float var3 = this.e().c() * var1;
      return new com.aspose.cells.b.a.b.zt(var2, var3);
   }

   protected float g() {
      return this.d / (1.0F + this.d()) * this.e;
   }

   protected void h() {
      double var1 = 0.0D;
      double[] var3 = this.i;
      int var4 = var3.length;

      int var5;
      for(var5 = 0; var5 < var4; ++var5) {
         double var6 = var3[var5];
         var1 += var6;
      }

      com.aspose.cells.b.a.b.zt var22 = this.e();
      com.aspose.cells.b.a.b.zt var23 = this.f();
      var5 = this.o.length - 1;
      float var24 = this.d();
      ArrayList var7 = new ArrayList();
      this.h.clear();
      int var8 = 0;
      int var9 = -1;
      int var10 = 0;
      double var11 = (double)this.f;

      for(int var13 = 0; var13 < this.i.length; ++var13) {
         double var14 = this.i[var13];
         double var16 = var14 / var1 * 360.0D;
         float var18 = this.o[var10];
         float var19 = this.o[var10];
         com.aspose.cells.b.a.b.zt var20;
         if (var18 > 0.0F) {
            var20 = this.a((float)(var11 + var16 / 2.0D), this.o[var10]);
            var18 = var20.b();
            var19 = var20.c();
         }

         var20 = null;
         zaui var25;
         if (var13 == this.t) {
            var25 = this.a(this.a + var23.b() / 2.0F + var18, this.b + var23.c() / 2.0F + var19, var22.b(), var22.c(), this.g(), (float)(var11 % 360.0D), (float)var16, this.k[var8], this.r, this.p, this.q);
         } else {
            zje var21 = this.j != null && var13 < this.j.getCount() ? this.j.b(var13) : null;
            var25 = this.a(this.a + var23.b() / 2.0F + var18, this.b + var23.c() / 2.0F + var19, var22.b(), var22.c(), this.g(), (float)(var11 % 360.0D), (float)var16, this.k[var8], this.r, this.p, this.q, var21);
         }

         var25.a(this.l[var13]);
         if (var9 <= -1 && (var11 > 270.0D || var11 + var16 <= 270.0D) && (var11 < 270.0D || var11 + var16 <= 630.0D)) {
            com.aspose.cells.b.a.a.ze.a(var7, (Object)var25);
            com.aspose.cells.b.a.a.ze.a(this.h, (Object)var13);
         } else {
            ++var9;
            var7.add(var9, var25);
            this.h.add(var9, var13);
         }

         if (var10 < var5) {
            ++var10;
         }

         ++var8;
         if (var8 >= this.k.length) {
            var8 = 0;
         }

         var11 += var16;
         if (var11 > 360.0D) {
            var11 -= 360.0D;
         }
      }

      this.g = (zaui[])((zaui[])com.aspose.cells.b.a.a.ze.a(var7, zaui.class));
   }

   protected zaui a(float var1, float var2, float var3, float var4, float var5, float var6, float var7, Color var8, int var9, int var10, float var11, zje var12) {
      return new zaui(var1, var2, var3, var4, var5, var6 % 360.0F, var7, var8, var9, var10, var11, var12);
   }

   protected zaui a(float var1, float var2, float var3, float var4, float var5, float var6, float var7, Color var8, int var9, int var10, float var11) {
      Color var12 = zkm.a(var8, zkm.a);
      return new zaui(var1, var2, var3, var4, var5, var6 % 360.0F, var7, var12, var9, var10, var11);
   }

   protected com.aspose.cells.b.a.b.zt a(float var1, float var2) {
      if (var2 == 0.0F) {
         return com.aspose.cells.b.a.b.zt.a();
      } else {
         float var3 = (float)((double)(this.e().b() * var2 / 2.0F) * Math.cos((double)var1 * 3.141592653589793D / 180.0D));
         float var4 = (float)((double)(this.e().c() * var2 / 2.0F) * Math.sin((double)var1 * 3.141592653589793D / 180.0D));
         return new com.aspose.cells.b.a.b.zt(var3, var4);
      }
   }

   protected void b(zn var1) {
      ArrayList var2 = new ArrayList();
      com.aspose.cells.b.a.a.ze.b(var2, this.g);
      zaui var3 = null;
      zaui[] var4;
      if (this.g[0].c() > 90.0F && this.g[0].c() <= 270.0F && this.g[0].c() + this.g[0].d() > 450.0F) {
         var3 = (zaui)var2.get(0);
         var4 = var3.c(0.0F);
         var2.set(0, var4[0]);
         if (var4[1].d() > 0.0F) {
            var2.add(1, var4[1]);
         }
      } else if (this.g[0].c() > 270.0F && this.g[0].c() + this.g[0].d() > 450.0F || this.g[0].c() < 90.0F && this.g[0].c() + this.g[0].d() > 270.0F) {
         var3 = (zaui)var2.get(0);
         var4 = var3.c(180.0F);
         var2.set(0, var4[1]);
         if (var4[1].d() > 0.0F) {
            com.aspose.cells.b.a.a.ze.a(var2, (Object)var4[0]);
         }
      }

      var3 = (zaui)var2.get(0);
      var3.a(var1);
      int var10 = 1;
      int var5 = var2.size() - 1;

      while(var10 < var5) {
         zaui var6 = (zaui)var2.get(var5);
         float var7 = var6.c() - 90.0F;
         if (var7 > 180.0F || var7 < 0.0F) {
            var7 = 0.0F;
         }

         zaui var8 = (zaui)var2.get(var10);
         float var9 = (450.0F - var8.f()) % 360.0F;
         if (var9 > 180.0F || var9 < 0.0F) {
            var9 = 0.0F;
         }

         if (var9 >= var7) {
            var8.a(var1);
            ++var10;
         } else if (var9 < var7) {
            var6.a(var1);
            --var5;
         }
      }

      var3 = (zaui)var2.get(var5);
      var3.a(var1);
   }

   protected void c(zn var1) {
      zaui[] var2 = this.g;
      int var3 = var2.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         zaui var5 = var2[var4];
         var5.f(var1);
      }

   }

   protected void d(zn var1) {
      zaui[] var2 = this.g;
      int var3 = var2.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         zaui var5 = var2[var4];
         var5.g(var1);
      }

   }
}
